import { _decorator, Component, Label, Node, Tween, tween, Vec3 } from 'cc';
import { GameMgr } from '../GameMgr';
import { EventMgr } from '../../EventMgr/EventMgr';
const { ccclass, property } = _decorator;

@ccclass('StagePanel')
export class StagePanel extends Component {

    lvLabel:Label|null=null;

    y:number=0;

    start() {
        this.y=this.node.position.y;
        console.log("stagepanel start"+this.y);

        this.lvLabel=this.node.getChildByPath("lvLabel").getComponent(Label);
        this.lvLabel.string=GameMgr.Inst.getCurSceneLv().toString();

    }
    gameStart(callBack:Function){


       let t:Tween<Node>= tween(this.node)
        .to(0,{position:new Vec3(0,0,0)})

        .delay(GameMgr.Inst.getQuickTime(2))
        .to(0,{position:new Vec3(0,this.y,0)})
        .call(callBack)
        .start();

        
        
    }
}


